package com.nervenets.web.hibernate.domain.statistics;

import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;

/**
 * Created by Joe on 2018/1/9.
 */
@Entity
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StatisticsOfUser extends DomainObject {
    private int newly;//新用户数量
    private int active;//活跃用户数量
    private int buy;//下单用户数量
    private int reBuy;//再次下单用户数量

    public void add(StatisticsOfUser count) {
        this.newly += count.getNewly();
        this.active += count.getActive();
        this.buy += count.getBuy();
        this.reBuy += count.getReBuy();
    }
}
